package com.yingyi.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.yingyi.basic.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;


@ApiModel(description = "部门信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    //private Long id;
    //编号
    @ApiModelProperty(value = "编号",required=true)
    private String sn;
    private String name;

    //部门层级路径
    @ApiModelProperty(value = "部门层级路径",required=true)
    private String dirPath;

    //启用状态
    @ApiModelProperty(value = "启用状态",required=true, example = "1")
    private Integer state = 1;

    //部门管理员的id
    @ApiModelProperty(value = "部门管理员的id",required=true, example = "1L")
    private Long manager_id;
    //manager_id对应的Employee对象
    @ApiModelProperty(value = "manager_id对应的Employee对象",required=true)
    private Employee manager;

    //上级部门
    @ApiModelProperty(value = "上级部门",required=true, example = "1L")
    private Long parent_id;
    //parent_id对应的部门
    @ApiModelProperty(value = "parent_id对应的部门",required=true)
    private Department parent;

    //当前部门的子部门
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @ApiModelProperty(value = "当前部门的子部门",required=true)
    private List<Department> children = new ArrayList<>();
}
